<!doctype html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<title>后台管理-WeAdmin Frame型后台管理系统-WeAdmin 1.0</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
	<link rel="stylesheet" href="./static/css/font.css">
	<script type="text/javascript"  src="./static/js/jquery.min.js" ></script>

	<script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
</head>

<body>
<!-- 顶部开始 -->
<div class="container">
	<div class="logo">
		<a href="./index.html">WeAdmin v1.0</a>
	</div>
	<div class="left_open">
		<i title="展开左侧栏" class="iconfont">&#xe699;</i>
	</div>
	<ul class="layui-nav left fast-add" lay-filter="">
		<li class="layui-nav-item">
			<a href="javascript:;">+新增</a>
			<dl class="layui-nav-child">
				<!-- 二级菜单 -->
				<dd>
					<a onclick="WeAdminShow('资讯','https://www.youfa365.com/')"><i class="iconfont">&#xe6a2;</i>资讯</a>
				</dd>
				<dd>
					<a onclick="WeAdminShow('图片','http://www.baidu.com')"><i class="iconfont">&#xe6a8;</i>图片</a>
				</dd>
				<dd>
					<a onclick="WeAdminShow('用户','https://www.youfa365.com/')"><i class="iconfont">&#xe6b8;</i>用户</a>
				</dd>
			</dl>
		</li>
	</ul>
	<ul class="layui-nav right" lay-filter="">
		<li class="layui-nav-item">
			<a href="javascript:;">Admin</a>
			<dl class="layui-nav-child">
				<!-- 二级菜单 -->
				<dd>
					<a onclick="WeAdminShow('个人信息','http://www.baidu.com')">个人信息</a>
				</dd>
				<dd>
					<a onclick="WeAdminShow('切换帐号','./login.html')">切换帐号</a>
				</dd>
				<dd>
					<a class="loginout" href="login.html">退出</a>
				</dd>
			</dl>
		</li>
		<li class="layui-nav-item to-index">
			<a href="/">前台首页</a>
		</li>
	</ul>

</div>
<!-- 顶部结束 -->
<!-- 中部开始 -->
<!-- 左侧菜单开始 -->
<div class="left-nav">
	<div id="side-nav">
		<ul id="nav">

		</ul>
	</div>
</div>
<!-- <div class="x-slide_left"></div> -->
<!-- 左侧菜单结束 -->
<!-- 右侧主体开始 -->
<div class="page-content">
	<div class="layui-tab tab" lay-filter="wenav_tab" id="WeTabTip" lay-allowclose="true">
		<ul class="layui-tab-title" id="tabName">
			<li lay-id="2" class="layui-this">今日概况</li>
		</ul>
		<div class="layui-tab-content">
			<div class="layui-tab-item layui-show">
				<iframe src='./pages/welcome.html' frameborder="0" scrolling="yes" class="weIframe"></iframe>
			</div>
		</div>
	</div>
</div>
<div class="page-content-bg"></div>
<!-- 右侧主体结束 -->
<!-- 中部结束 -->
<!-- 底部开始 -->
<div class="footer">
	<div class="copyright">Copyright ©2018 WeAdmin v1.0 All Rights Reserved</div>
</div>
<!-- 底部结束 -->
<script src="./static/js/republic.js" charset="utf-8"></script>
<script type="text/javascript">

    $(function () {
        var jsessionid= localStorage.getItem("jsessionid")
        var  url = serverUrl + "/index;jsessionid="+jsessionid;
        var placeUrl  = './static/images/'

        $.ajax({
            type: "GET",
            url: url,
            xhrFields: {
                withCredentials : true
            },
            success: function (r) {
                if (r.code == 0) {
                    $.each(r.data,function (key,value) {
                        // if(value.child.length>0){

                        var  menuPerms = value.menu_id;
                        $("#nav").append("<li><a href=\"javascript:;\" class='open'><i class=\"iconfont\"><img src='"+placeUrl+value.icon+'.png'+"' alt=''></i><cite>"+value.name+"</cite>" +
                            "<i class=\"iconfont nav_right\"></i></a><ul style='display: inline-block' id="+menuPerms+" class=\"sub-menu\"></ul></li>");
                            $.each(value.child,function (key,value) {
                                $('#'+menuPerms).append("<li><a _href='"+value.url+"'><i class=\"iconfont\"></i>" +
                                    "<cite>"+value.name+"</cite></a></li>");
                            });
                        // }

                    });
                    layui.config({
                        base: './static/js/'
                        ,version: '101100'
                    }).use('admin');
                } else if(r.code = 2 ){
                    alert(r.msg);
                    document.location.href = "./login.html";
                }else {
                    alert(r.msg);
                }
            },
        });
    });

</script>
<link rel="stylesheet" href="./static/css/weadmin.css">

</body>
<!--Tab菜单右键弹出菜单-->
<ul class="rightMenu" id="rightMenu">
	<li data-type="fresh">刷新</li>
	<li data-type="current">关闭当前</li>
	<li data-type="other">关闭其它</li>
	<li data-type="all">关闭所有</li>
</ul>

</html>